package cn.iune.erp.inventory;

import java.math.BigDecimal;

import java.sql.Date;
import java.sql.Timestamp;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.persistence.UniqueConstraint;
import javax.persistence.Version;

import com.justep.baas.data.RowState;

@Entity
@Table(name="ItemBatch",uniqueConstraints={@UniqueConstraint(columnNames={"itemID", "batchNo", "enterpriseNo"})})
@NamedQuery(name="ItemBatch.findAll", query="SELECT s FROM ItemBatch s")
public class ItemBatch {

	public ItemBatch() {

	}

	@Id
	@Column(length=36)
	private String fID;
	
	@Column(length=32)
	private String systemCode;
	@Column(length=4)
	private String billType;
	@Column(length=20)
	private String billTypeName;
	private Date orderDate;
	@Column(length=10)
	private String state;
	@Column(length=10)
	private String status;
	
	@Column(length=32)
	private String itemID;
	@Column(length=30)
	private String itemNo;
	@Column(length=100)
	private String itemName;
	@Column(length=512)
	private String itemProperty;
	@Transient
	private String itemDescribe;
	@Column(length=15)
	private String unitCode;
	@Column(length=20)
	private String unitName;

	@Column(length=20)
	private String batchNo;
	@Column(length=50)
	private String batchDescribe;
	
	private int qualityPeriod = 0;//启用保质期管理
	private int validDays = 0;//有效天数
	private int checkoutAgainDays = 0;//复检天数
	private int qualityType = 0;
	@Column(length=10)
	private String qualityTypeLabel = "0:免检";//0:免检,1:抽检,2:全检

	@Column(length=1)
	private String process;
	@Column(length=10)
	private String processLabel;
	
	@Column(length=20)
	private String storeNo;
	
	private Date produceDate;//生产日期
	private Date validDate;//有效日期
	private Date checkoutAgainDate;//复检日期
	
	private Date firstStoreDate;//入库日期
	private Date lastCheckDate;//盘点日期

	@Column(length=10)
	private String brand;
	@Column(length=20)
	private String brandLabel;
	@Column(length=20)
	private String placeOrigin;
	@Column(length=128)
	private String manufacturer;
	
	@Column(length=32)
	private String providerID;
	
	@Column(length=3)
	private String storageTypeD;
	@Column(length=20)
	private String storageTypeDLabel;
	@Column(length=32)
	private String providerNo;
	@Column(length=20)
	private String shortName;
	@Column(length=128)
	private String providerName;
	
	@Column(length=4)
	private String origin;
	@Column(length=20)
	private String originName;
	@Column(length=20)
	private String originNo;
	@Column(length=5)
	private String originSerialNo;

	@Column(precision=10,scale=2)
	private BigDecimal itemQuantityL = BigDecimal.ZERO; //库存数量	
	@Column(precision=10,scale=2)
	private BigDecimal pieceQuantityL = BigDecimal.ZERO;
	
	@Column(length=1)
	private String lockFlag;

	@Column(length=255)
	private String comments;
	
	@Column(length=15)
	private String cUsercode;
	@Column(length=20)
	private String cUsername;//制单人
	private Timestamp cDatetime;
	@Column(length=15)
	private String tUsercode;
	@Column(length=20)
	private String tUsername;//审核人
	private Timestamp tDatetime;
	@Column(length=15)
	private String eUsercode;
	@Column(length=20)
	private String eUsername;//关单人
	private Timestamp eDatetime;
	
	@Column(length=65)
	private String userId;

	@Column(length=128)
	private String enterpriseNo;
	@Column(length=128)
	private String enterpriseName;

	@Version
	private int version = 0;
	
	@Transient//非持久字段
	private RowState rowState;
	public RowState getRowState() {
		return rowState;
	}
	public void setRowState(RowState rowState) {
		this.rowState = rowState;
	}

	public String getcUsercode() {
		return cUsercode;
	}

	public void setcUsercode(String cUsercode) {
		this.cUsercode = cUsercode;
	}

	public String getcUsername() {
		return cUsername;
	}

	public void setcUsername(String cUsername) {
		this.cUsername = cUsername;
	}

	public Timestamp getcDatetime() {
		return cDatetime;
	}

	public void setcDatetime(Timestamp cDatetime) {
		this.cDatetime = cDatetime;
	}

	public String gettUsercode() {
		return tUsercode;
	}

	public void settUsercode(String tUsercode) {
		this.tUsercode = tUsercode;
	}

	public String gettUsername() {
		return tUsername;
	}

	public void settUsername(String tUsername) {
		this.tUsername = tUsername;
	}

	public Timestamp gettDatetime() {
		return tDatetime;
	}

	public void settDatetime(Timestamp tDatetime) {
		this.tDatetime = tDatetime;
	}

	public String geteUsercode() {
		return eUsercode;
	}

	public void seteUsercode(String eUsercode) {
		this.eUsercode = eUsercode;
	}

	public String geteUsername() {
		return eUsername;
	}

	public void seteUsername(String eUsername) {
		this.eUsername = eUsername;
	}

	public Timestamp geteDatetime() {
		return eDatetime;
	}

	public void seteDatetime(Timestamp eDatetime) {
		this.eDatetime = eDatetime;
	}

	public int getVersion() {
		return version;
	}

	public void setVersion(int version) {
		this.version = version;
	}


	public String getState() {
		return state;
	}

	public void setState(String state) {
		this.state = state;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public String getBillType() {
		return billType;
	}

	public void setBillType(String billType) {
		this.billType = billType;
	}

	public String getBillTypeName() {
		return billTypeName;
	}

	public void setBillTypeName(String billTypeName) {
		this.billTypeName = billTypeName;
	}

	public String getOrigin() {
		return origin;
	}
	public void setOrigin(String origin) {
		this.origin = origin;
	}
	public String getOriginName() {
		return originName;
	}
	public void setOriginName(String originName) {
		this.originName = originName;
	}
	public String getOriginNo() {
		return originNo;
	}
	public void setOriginNo(String originNo) {
		this.originNo = originNo;
	}
	public String getBrandLabel() {
		return brandLabel;
	}

	public void setBrandLabel(String brandLabel) {
		this.brandLabel = brandLabel;
	}

	public String getLockFlag() {
		return lockFlag;
	}

	public void setLockFlag(String lockFlag) {
		this.lockFlag = lockFlag;
	}

	public String getfID() {
		return fID;
	}
	public void setfID(String fID) {
		this.fID = fID;
	}


	public BigDecimal getItemQuantityL() {
		return itemQuantityL;
	}
	public void setItemQuantityL(BigDecimal itemQuantityL) {
		this.itemQuantityL = itemQuantityL;
	}
	public BigDecimal getPieceQuantityL() {
		return pieceQuantityL;
	}

	public void setPieceQuantityL(BigDecimal pieceQuantityL) {
		this.pieceQuantityL = pieceQuantityL;
	}

	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	public String getEnterpriseNo() {
		return enterpriseNo;
	}

	public void setEnterpriseNo(String enterpriseNo) {
		this.enterpriseNo = enterpriseNo;
	}

	public String getEnterpriseName() {
		return enterpriseName;
	}

	public void setEnterpriseName(String enterpriseName) {
		this.enterpriseName = enterpriseName;
	}

	public String getBatchNo() {
		return batchNo;
	}

	public void setBatchNo(String batchNo) {
		this.batchNo = batchNo;
	}

	public String getBatchDescribe() {
		return batchDescribe;
	}

	public void setBatchDescribe(String batchDescribe) {
		this.batchDescribe = batchDescribe;
	}

	public Date getFirstStoreDate() {
		return firstStoreDate;
	}

	public void setFirstStoreDate(Date firstStoreDate) {
		this.firstStoreDate = firstStoreDate;
	}

	public Date getProduceDate() {
		return produceDate;
	}

	public void setProduceDate(Date produceDate) {
		this.produceDate = produceDate;
	}

	public Date getValidDate() {
		return validDate;
	}

	public void setValidDate(Date validDate) {
		this.validDate = validDate;
	}

	public Date getCheckoutAgainDate() {
		return checkoutAgainDate;
	}

	public void setCheckoutAgainDate(Date checkoutAgainDate) {
		this.checkoutAgainDate = checkoutAgainDate;
	}

	public Date getLastCheckDate() {
		return lastCheckDate;
	}

	public void setLastCheckDate(Date lastCheckDate) {
		this.lastCheckDate = lastCheckDate;
	}

	public String getComments() {
		return comments;
	}

	public void setComments(String comments) {
		this.comments = comments;
	}

	public String getBrand() {
		return brand;
	}

	public void setBrand(String brand) {
		this.brand = brand;
	}

	public String getPlaceOrigin() {
		return placeOrigin;
	}

	public void setPlaceOrigin(String placeOrigin) {
		this.placeOrigin = placeOrigin;
	}

	public String getManufacturer() {
		return manufacturer;
	}

	public void setManufacturer(String manufacturer) {
		this.manufacturer = manufacturer;
	}


	public Date getOrderDate() {
		return orderDate;
	}

	public void setOrderDate(Date orderDate) {
		this.orderDate = orderDate;
	}

	public String getSystemCode() {
		return systemCode;
	}
	public void setSystemCode(String systemCode) {
		this.systemCode = systemCode;
	}
	public String getItemID() {
		return itemID;
	}
	public void setItemID(String itemID) {
		this.itemID = itemID;
	}
	public String getItemProperty() {
		return itemProperty;
	}
	public void setItemProperty(String itemProperty) {
		this.itemProperty = itemProperty;
	}
	public String getProviderID() {
		return providerID;
	}
	public void setProviderID(String providerID) {
		this.providerID = providerID;
	}
	public String getItemNo() {
		return itemNo;
	}
	public void setItemNo(String itemNo) {
		this.itemNo = itemNo;
	}
	public String getItemName() {
		return itemName;
	}
	public void setItemName(String itemName) {
		this.itemName = itemName;
	}
	public String getItemDescribe() {
		return itemDescribe;
	}
	public void setItemDescribe(String itemDescribe) {
		this.itemDescribe = itemDescribe;
	}
	public String getUnitCode() {
		return unitCode;
	}
	public void setUnitCode(String unitCode) {
		this.unitCode = unitCode;
	}
	public String getUnitName() {
		return unitName;
	}
	public void setUnitName(String unitName) {
		this.unitName = unitName;
	}
	public int getQualityPeriod() {
		return qualityPeriod;
	}
	public void setQualityPeriod(int qualityPeriod) {
		this.qualityPeriod = qualityPeriod;
	}
	public String getStorageTypeD() {
		return storageTypeD;
	}
	public void setStorageTypeD(String storageTypeD) {
		this.storageTypeD = storageTypeD;
	}
	public String getStorageTypeDLabel() {
		return storageTypeDLabel;
	}
	public void setStorageTypeDLabel(String storageTypeDLabel) {
		this.storageTypeDLabel = storageTypeDLabel;
	}
	public String getProviderNo() {
		return providerNo;
	}
	public void setProviderNo(String providerNo) {
		this.providerNo = providerNo;
	}
	public String getShortName() {
		return shortName;
	}
	public void setShortName(String shortName) {
		this.shortName = shortName;
	}
	public String getProviderName() {
		return providerName;
	}
	public void setProviderName(String providerName) {
		this.providerName = providerName;
	}
	public int getValidDays() {
		return validDays;
	}
	public void setValidDays(int validDays) {
		this.validDays = validDays;
	}
	public int getCheckoutAgainDays() {
		return checkoutAgainDays;
	}
	public void setCheckoutAgainDays(int checkoutAgainDays) {
		this.checkoutAgainDays = checkoutAgainDays;
	}
	public int getQualityType() {
		return qualityType;
	}
	public void setQualityType(int qualityType) {
		this.qualityType = qualityType;
	}
	public String getQualityTypeLabel() {
		return qualityTypeLabel;
	}
	public void setQualityTypeLabel(String qualityTypeLabel) {
		this.qualityTypeLabel = qualityTypeLabel;
	}
	public String getProcess() {
		return process;
	}
	public void setProcess(String process) {
		this.process = process;
	}
	public String getProcessLabel() {
		return processLabel;
	}
	public void setProcessLabel(String processLabel) {
		this.processLabel = processLabel;
	}
	public String getStoreNo() {
		return storeNo;
	}
	public void setStoreNo(String storeNo) {
		this.storeNo = storeNo;
	}
	public String getOriginSerialNo() {
		return originSerialNo;
	}
	public void setOriginSerialNo(String originSerialNo) {
		this.originSerialNo = originSerialNo;
	}

}